<?php
class Zend_Controller_Action_Helper_Security extends Zend_Controller_Action_Helper_Abstract{
	public function removeCaptcha(Zend_Form $form){
		$auth = Zend_Auth::getInstance();
		if($auth->hasIdentity()){
			$form->removeElement('captcha');
		}
	}
	public function userID(){
		$auth = Zend_Auth::getInstance();
		if($auth->hasIdentity()){
			return $auth->getIdentity()->etudiant_id;
		}else{
			return null;
		}
	}
	public function userPseudo(){
		$auth = Zend_Auth::getInstance();
		if($auth->hasIdentity()){
			return $auth->getIdentity()->pseudo;
		}else{
			return 'Guest';
		}
	}
}